
package edu.wpi.first.wpilibj.templates.commands;


/**
 *
 * @author Jaren Marler
 */
public class DoShootOld extends CommandBase {
    private boolean forward;
    private double speed;
    
    public DoShootOld() {
         // Use requires() here to declare subsystem dependencies
        // eg. requires(chassis);
        requires(myHopper);
    }

    // Called just before this Command runs the first time
    protected void initialize() {
        forward = true;
        // set the speed from 0 to 1 second based on the joystick
        speed = 0.5;
        myHopper.setSpeed(speed);
    }

    // Called repeatedly when this Command is scheduled to run
    protected void execute() {
        if ((myHopper.getStopSwitchState() == true) && (forward == true)) {
            myHopper.setSpeed(-speed);
            forward = false;
        }
    }
                
    // Make this return true when this Command no longer needs to run execute()
    protected boolean isFinished() {
        if((forward == false) && (myHopper.getStartSwitchState() == true)) {
            return true;
        }
        return false;
    }

    // Called once after isFinished returns true
    protected void end() {
        myHopper.setSpeed(0.0);
    }

    // Called when another command which requires one or more of the same
    // subsystems is scheduled to run
    protected void interrupted() {
        end();
    }
}
